<!-- 危化品管理-危废品库存-出库查询 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="8">
            <el-form-item label="日期">
              <el-date-picker v-model="fbillcredate" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
                start-placeholder="开始日期" end-placeholder="结束日期">
              </el-date-picker>
            </el-form-item>
          </el-col>

          <template v-if="showAll">

            <el-col :span="6">
            <el-form-item label="仓库">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

            <el-col :span="6">
            <el-form-item label="处置企业">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>


          <el-col :span="6">
            <el-form-item label="出库人员">
              <el-input v-model="listQuery.fcatno" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>

        </template>

          <el-col :span="12">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
              <el-button type="success" icon="el-icon-download">导出</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FBILLNO" label="单号" width="105"></el-table-column>
          <el-table-column prop="FBILLCREDATE" label="出库日期" ></el-table-column>
          <el-table-column prop="FSTOCK" label="存放仓库" width="95"></el-table-column>
          <el-table-column prop="FSUPPLIER" label="处置企业" ></el-table-column>
          <el-table-column prop="FUSER" label="出库人员" width="85"></el-table-column>
          <el-table-column prop="FSRCNO" label="入库批号" width="95"></el-table-column>
          <el-table-column prop="FCATNO" label="桶固定码" width="95"></el-table-column>
          <el-table-column prop="FCATNAME" label="危废名称" width="95"></el-table-column>
          <el-table-column prop="FWEIGHT" label="入库重量(kg)" width="95"></el-table-column>
          <el-table-column prop="FOUTQTY" label="出库重量(kg)" width="95"></el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" />
        <Form ref="Form" :parelist="list" />
      </div>
    </div>
  </div>
</template>

<script>
  import Form from "./Form.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll:false,
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],

        fvisiblelist: [
          { id: "1", fullName: "有效" },
          { id: "0", fullName: "无效" },
        ],
        total: 0,
        list: [
        {
          "FBILLNO":"T20240901001",
          "FBILLCREDATE":"2024-09-01 17:00:12",
          "FSTOCK":"生物系仓库",
          "FUSER":"韩信",
          "FCATNO":"Z24080100028",
          "FCATNAME":"危废化学品盛漏油桶",
          "FNAME":"生物实验废物",
          "FWEIGHT":"45.0",
          "FSUPPLIER":"江苏金聚鑫再生资源回收有限公司",
          "FOUTQTY":"45.0",
          "FSRCNO":"20240901001"
        },{
          "FBILLNO":"20240905023",
          "FBILLCREDATE":"2024-09-05 17:00:12",
          "FSTOCK":"生物系仓库",
          "FUSER":"韩信",
          "FCATNO":"Z240801000965",
          "FCATNAME":"危废化学品盛漏油桶",
          "FNAME":"生物实验废物",
          "FWEIGHT":"53.7",
          "FSUPPLIER":"江苏金聚鑫再生资源回收有限公司",
          "FOUTQTY":"45.0",
          "FSRCNO":"20240901001"
        },{
          "FBILLNO":"20240906012",
          "FBILLCREDATE":"2024-09-06 16:45:54",
          "FSTOCK":"生物系仓库",
          "FUSER":"韩信",
          "FCATNO":"Z240821000678",
          "FCATNAME":"危废化学品盛漏油桶",
          "FNAME":"生物实验废物",
          "FWEIGHT":"60.9",
          "FSUPPLIER":"江苏金聚鑫再生资源回收有限公司",
          "FOUTQTY":"45.0",
          "FSRCNO":"20240901001"
        },{
          "FBILLNO":"20240907023",
          "FBILLCREDATE":"2024-09-07 17:21:12",
          "FSTOCK":"生物系仓库",
          "FUSER":"韩信",
          "FCATNO":"Z24080100028",
          "FCATNAME":"危废化学品盛漏油桶",
          "FNAME":"生物实验废物",
          "FWEIGHT":"45.0",
          "FSUPPLIER":"江苏金聚鑫再生资源回收有限公司",
          "FOUTQTY":"45.0",
          "FSRCNO":"20240901001"
        },{
          "FBILLNO":"2024090891",
          "FBILLCREDATE":"2024-09-08 16:03:12",
          "FSTOCK":"生物系仓库",
          "FUSER":"韩信",
          "FCATNO":"Z24080100028",
          "FCATNAME":"危废化学品盛漏油桶",
          "FNAME":"生物实验废物",
          "FWEIGHT":"45.0", 
          "FSUPPLIER":"江苏金聚鑫再生资源回收有限公司",
          "FOUTQTY":"45.0",
          "FSRCNO":"20240901001"
        }
        ],

        //所属教学楼选择数据
        options1: [{
          value: '20E01',
          label: '第一教学楼'
        }, {
          value: '20E02',
          label: '化学楼'
        }, {
          value: '20N03',
          label: '综合实验楼'
        }, {
          value: '20E04',
          label: '第二教学楼'
        }],

        options2: [{
          value: '1',
          label: '化学系仓库'
        }, {
          value: '2',
          label: '生物系仓库'
        }],

        loading: false,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fcatno: "",
          fcatname: ""
        },
      };
    },
    computed: {},
    created() {
    },
    methods: {
      insert(row) {
        this.$refs.Form.init(row);
      },
    },
  };
</script>